//
//  TaoBaoViewController.m
//  jipin
//
//  Created by chuangjia on 19/5/15.
//  Copyright (c) 2015 liuchengbin. All rights reserved.
//

#import "TaoBaoViewController.h"
#import "ZShare.h"
#import "BaseModel.h"
@interface TaoBaoViewController ()<UIWebViewDelegate>
@property(nonatomic,strong)UIWebView *webView;
@end

@implementation TaoBaoViewController
@synthesize photo_id=_photo_id;
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.isComment=YES;
    self.navTitle =self.titleStr;
     [UMengShare event:CK_TAOBAO acc:1];
    _webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, self.navHeight, self.view.frame.size.width, self.view.frame.size.height-self.navHeight)];
    [_webView setDelegate:self];
    [ZShare showAnimationView:self.view center:CGPointZero];
    NSURLRequest *request =[NSURLRequest requestWithURL:[NSURL URLWithString:self.linkUrl]];
    [self.view addSubview: _webView];
    [_webView loadRequest:request];
    [BaseModel tongjiBuy:@{@"photo_id":self.photo_id} success:^(AFHTTPRequestOperation *operation, id result) {
    } failure:^(NSError *error) {
    }];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
      DLog(@"%s", __PRETTY_FUNCTION__);
}

- (void) webViewDidStartLoad:(UIWebView *)webView
{
    DLog(@"webViewDidStartLoad");
}
- (void) webViewDidFinishLoad:(UIWebView *)webView
{
    [ZShare hiddenAnimationView:self.view];
    DLog(@"webViewDidFinishLoad");
}
- (void) webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
{
    [ZShare hiddenAnimationView:self.view];
    DLog(@"didFailLoadWithError:%@", error);
}
@end
